package com.nineclock.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nineclock.system.pojo.SysCompany;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface SysCompanyMapper extends BaseMapper<SysCompany> {

    @Select("SELECT * FROM sys_company WHERE id IN (SELECT company_id FROM sys_company_user WHERE user_id = #{userId})")
    public List<SysCompany> queryCompanyByUserId(@Param("userId") Long userId);

}
